package com.stu.covid.business.utils;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

//获取结果工具类
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> implements Serializable {
    private int code;//id
    private String msg;//消息
    private int count;//数量
    private List<T> data;//泛型数据集合
    private T obj;//其他

    public Result(int code, String msg, int count, List<T> data) {
        this.code = code;
        this.msg = msg;
        this.count = count;
        this.data = data;
    }

    public Result(int code, String msg, T obj) {
        this.code = code;
        this.msg = msg;
        this.obj = obj;
    }

    public Result(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
